Inheritance is the object-oriented mechanism to extend or refine a class definition. With derivation the (new) class inherits all data and functionality of the parent class. Only new data/methods or refined methods need to be specified explicitly. Due to this property, inheritance is a key concept for improved reuse.

Remember the classification of a car. More specialized cars can be derived from this car:


Both cars, the electrical as well as the gas-car, inherit the attributes current_speed and max_speed as well as the methods speed_up and slow_down from the parent class car. In addition new attributes (fuel, accu_status) and new methods (display_accu_status, display_fuel_status) are added.

The inherited methods can be redefined inside the derived class (e.g. the speed_up method needs different implementations for e- and gas-car).

After redefining inherited items the original items are still available, but they are now hidden by the new ones. Most languages provide mechanisms to reference hidden items explicitly.

In this example e-car and gas-car inherit only from one parent (car). This is called single inheritance. Some object-oriented languages allow to inherit from more than one parent. This is called multiple inheritance. Objective VHDL does only support single inheritance.